home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
X User Tools
/
X User Tools (O'Reilly and Associates)(1994).ISO
/
sun4c
/
archive
/
tcltk.z
/
tcltk
/
man
/
cat3
/
GetPixels.3
< prev
next >
Wrap
Text File
|
1994-09-20
|
5KB
|
133 lines
Tk_GetPixels(3) Tk Library Procedures
_________________________________________________________________
NAME
Tk_GetPixels, Tk_GetScreenMM - translate between strings and |
screen units |
SYNOPSIS |
#include <tk.h> |
int |
Tk_GetPixels(_i_n_t_e_r_p, _t_k_w_i_n, _s_t_r_i_n_g, _i_n_t_P_t_r) |
int |
Tk_GetScreenMM(_i_n_t_e_r_p, _t_k_w_i_n, _s_t_r_i_n_g, _d_o_u_b_l_e_P_t_r) |
ARGUMENTS |
Tcl_Interp *_i_n_t_e_r_p (in) ||
Interpreter to use for |
error reporting. |
Tk_Window _t_k_w_i_n (in) ||
Window whose screen |
geometry determines the |
conversion between abso- |
lute units and pixels. |
char *_s_t_r_i_n_g (in) ||
String that specifies a |
distance on the screen. |
int *_i_n_t_P_t_r (out) ||
Pointer to location in |
which to store converted |
distance in pixels. |
double *_d_o_u_b_l_e_P_t_r (out) ||
Pointer to location in |
which to store converted |
distance in millimeters. |
_________________________________________________________________ |
DESCRIPTION |
These two procedures take as argument a specification of |
distance on the screen (_s_t_r_i_n_g) and compute the correspond- |
ing distance either in integer pixels or floating-point mil- |
limeters. In either case, _s_t_r_i_n_g specifies a screen dis- |
tance as a floating-point number followed by one of the fol- |
lowing characters that indicates units: |
<none> ||
The number specifies a distance in pixels. |
Tk 1
Tk_GetPixels(3) Tk Library Procedures
c ||
The number specifies a distance in centimeters on the |
screen. |
i ||
The number specifies a distance in inches on the |
screen. |
m ||
The number specifies a distance in millimeters on the |
screen. |
p ||
The number specifies a distance in printer's points |
(1/72 inch) on the screen. |
Tk_GetPixels converts _s_t_r_i_n_g to the nearest even number of |
pixels and stores that value at *_i_n_t_P_t_r. Tk_GetScreenMM |
converts _s_t_r_i_n_g to millimeters and stores the double- |
precision floating-point result at *_d_o_u_b_l_e_P_t_r. |
Both procedures return TCL_OK under normal circumstances. |
If an error occurs (e.g. _s_t_r_i_n_g contains a number followed |
by a character that isn't one of the ones above) then |
TCL_ERROR is returned and an error message is left in |
_i_n_t_e_r_p->_r_e_s_u_l_t. |
KEYWORDS |
centimeters, convert, inches, millimeters, pixels, points, |
screen units
Tk 2